import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useCommonStore = defineStore('common', () => {
  // 状态定义
  const globalTime = ref(0)
  // 音频情感
  const audioEmotion = ref('')
  // 音频语速
  const audioSpeed = ref('')

  // 方法定义
  const setGlobalTime = (time: number) => {
    globalTime.value = time
  }
  const setAudioEmotion = (emotion: string) => {
    audioEmotion.value = emotion
  }
  const setAudioSpeed = (speed: string) => {
    audioSpeed.value = speed
  }


  return {
    // 状态
    globalTime,audioEmotion,audioSpeed,

    // 方法
    setGlobalTime,setAudioEmotion,setAudioSpeed
  }
})
